/**
 * @auth NoahLiu
 * @team 星城前端团队
 * @description 提示消息
 * @param title 提示内容
 * @param icon 消息类型
 */
export default function (title: string, icon: "success" | "error" | "loading" | "none" = "none", duration: number = 3000) {
  return new Promise((resolve, reject) => {
    uni.showToast({
      duration,
      icon,
      title,
      success(result) {
        resolve(result);
      },
      fail(result) {
        reject(result);
      },
    });
  });
}
